{% load  static from staticfiles  %}
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>云平台管理系统</title>

  <!-- Google Font: Source Sans Pro -->
<!--  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700&display=fallback">-->
  <!-- Font Awesome Icons -->
  <link rel="stylesheet" href="{% static 'myadmin/plugins/fontawesome-free/css/all.min.css' %}">
  <!-- overlayScrollbars -->
  <link rel="stylesheet" href="{% static 'myadmin/plugins/overlayScrollbars/css/OverlayScrollbars.min.css'%}">
  <!-- Theme style -->
  <link rel="stylesheet" href="{% static 'myadmin/dist/css/adminlte.min.css'%}">


</head>

<body class="hold-transition sidebar-mini layout-fixed layout-navbar-fixed layout-footer-fixed" >
<div class="wrapper">

  <nav class="main-header navbar navbar-expand navbar-white navbar-light">

    <!-- Left navbar links -->
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
      </li>
    </ul>

    <!-- Right navbar links -->
    <ul class="navbar-nav ml-auto">
      <li class="nav-item">
        <a class="nav-link" data-widget="fullscreen" href="#" role="button">
          <i class="fas fa-expand-arrows-alt"></i>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-widget="control-sidebar" data-slide="true" href="#" role="button">
          <i class="fas fa-th-large"></i>
        </a>
      </li>
    </ul>
</nav>
 
  <!-- Main Sidebar Container -->
  <aside class="main-sidebar sidebar-dark-primary elevation-4">
    <!-- Brand Logo -->
    <a href="index3.html" class="brand-link">
      <span class="brand-text font-weight-light">云平台管理系统</span>
    </a>
    <!-- Sidebar -->
    <div class="sidebar">
      <!-- Sidebar user panel (optional) -->
      <div class="user-panel mt-3 pb-3 mb-3 d-flex">
        <div class="image">
          <img src="{% static 'myadmin/dist/img/user2-160x160.jpg' %}" class="img-circle elevation-2" alt="User Image">
        </div>
        <div class="info">
          <a href="#" class="d-block">{{ request.session.adminuser.nickname }}</a>
        </div>
         <div class="info">
            <a href="{% url 'myadmin_logout' %}" class="d-block">退出系统</a>
         </div>
      </div>


      <!-- Sidebar Menu -->
      <nav class="mt-2">
        <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false">
          <!-- Add icons to the links using the .nav-icon class
               with font-awesome or any other icon font library -->
          <li class="nav-item menu-open">
            <a href="#" class="nav-link active">
              <i class="nav-icon fas fa-tachometer-alt"></i>
              <p>
                功能菜单
                <i class="right fas fa-angle-left"></i>
              </p>
            </a>
            <ul class="nav nav-treeview">
              <li class="nav-item">
                <a href="/myadmin/flavor/index?index=1" class="nav-link" id="menu-section-1">
                  <i class="far fa-circle nav-icon"></i>
                  <p>实例类型</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="/myadmin/image/index?index=2" class="nav-link"  id="menu-section-2">
                  <i class="far fa-circle nav-icon"></i>
                  <p>镜像管理</p>
                </a>
              </li>
              <li class="nav-item">
                <a href="/myadmin/network/index?index=3" class="nav-link"  id="menu-section-3">
                  <i class="far fa-circle nav-icon"></i>
                  <p>网络管理</p>
                </a>
              </li>
                <li class="nav-item">
                <a href="./index2.html" class="nav-link"  id="menu-section-4">
                  <i class="far fa-circle nav-icon"></i>
                  <p>云主机管理</p>
                </a>
              </li>
<!--              <li class="nav-item">-->
<!--                <a href="./index2.html" class="nav-link"  id="menu-section-5">-->
<!--                  <i class="far fa-circle nav-icon"></i>-->
<!--                  <p>卷管理</p>-->
<!--                </a>-->
<!--              </li>-->
              <li class="nav-item">
                <a href="{% url 'myadmin_user_index' %}?index=5" class="nav-link"  id="menu-section-5">
                  <i class="far fa-circle nav-icon"></i>
                  <p>用户管理 </p>
                </a>
              </li>
            </ul>
          </li>
         
        </ul>
      </nav>
      <!-- /.sidebar-menu -->
    </div>

    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
     <!--模板占位开始-->
     {% block main_body %}
     {% endblock %}
      <!--模板占位结束-->
  </div>
  <!-- /.content-wrapper -->

  <!-- Control Sidebar -->
  <aside class="control-sidebar control-sidebar-dark">
    <!-- Control sidebar content goes here -->
  </aside>
  <!-- /.control-sidebar -->

  <!-- Main Footer -->
  <footer class="main-footer">
    <strong>Copyright &copy; 2014-2020 <a href="https://www.tjdz.deu.cn">天津电子信息职业技术学院</a>.</strong>
    All rights reserved.
    <div class="float-right d-none d-sm-inline-block">
      <b>Version</b> 1.0.0.1
    </div>
  </footer>
</div>
<!-- ./wrapper -->

<!-- REQUIRED SCRIPTS -->
<!-- jQuery -->
<script src="{% static 'myadmin/plugins/jquery/jquery.min.js' %}"></script>
<!-- Bootstrap -->
<script src="{% static 'myadmin/plugins/bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<!-- overlayScrollbars -->
<script src="{% static 'myadmin/plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js' %}"></script>
<!-- AdminLTE App -->
<script src="{% static 'myadmin/dist/js/adminlte.js' %}"></script>

<!-- PAGE PLUGINS -->
<!-- jQuery Mapael -->
<script src="{% static 'myadmin/plugins/jquery-mousewheel/jquery.mousewheel.js' %}"></script>
<script src="{% static 'myadmin/plugins/raphael/raphael.min.js' %}"></script>
<script src="{% static 'myadmin/plugins/jquery-mapael/jquery.mapael.min.js' %}"></script>

<!-- ChartJS -->
<script src="{% static 'myadmin/plugins/chart.js/Chart.min.js' %}"></script>

<!-- AdminLTE for demo purposes -->
<script src="{% static 'myadmin/dist/js/demo.js' %}"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="{% static 'myadmin/dist/js/pages/dashboard2.js' %}"></script>

<script>
  window.onload= function (){
    var query = window.location.search.substring(1);
    var vars = query.split("=");
    selectedIndex=1;
    if(vars.length==2){
      selectedIndex=vars[1];
    }
    //alert(selectedIndex);
    let selectedMenu = document.getElementsByClassName("nav-link");
    for(let i=1;i<=selectedMenu.length;i++){
       if(i==selectedIndex){
          selectedMenu = document.getElementById('menu-section-'+selectedIndex);
          //alert(selectedMenu);
          selectedMenu.setAttribute("class", "nav-link active");
        }
       else {
         // selectedMenu.setAttribute("class", "nav-link");
        }
    }

 }

</script>

</body>
</html>
